home *** CD-ROM | disk | FTP | other *** search
/ Internet Publisher's Toolbox 2.0 / Internet Publisher's Toolbox.iso / internet / ntserver / wtsource / futil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.5 KB  |  85 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.  
  4.   
  5. */
  6.  
  7. /* Copyright (c) CNIDR (see ../COPYRIGHT) */
  8.  
  9.  
  10. #ifndef FUTIL_H
  11. #define FUTIL_H
  12.  
  13. #include "cdialect.h"
  14. #include "cutil.h"
  15.  
  16.  
  17. #define MAX_FILE_NAME_LEN 255
  18.  
  19. #define FType long
  20.  
  21. /* the following defines should be in stdio.h, but the
  22.    gnu C compiler doesn't define them for some reason
  23.  */
  24. #ifndef SEEK_SET 
  25. #define SEEK_SET 0  /* ANSI added by brewster */
  26. #define SEEK_CUR 1  /* ANSI added by brewster */
  27. #define SEEK_END 2  /* ANSI added by brewster */
  28. #endif
  29.  
  30. /* enhanced standard functions - don't call them directly, use the
  31.    macros below */
  32. FILE*   fs_fopen _AP((char* fileName,char* mode));
  33. long    fs_fclose _AP((FILE* file));
  34. long    fs_fseek _AP((FILE* file,long offset,long wherefrom));
  35. long    fs_ftell _AP((FILE* file));
  36. char    *fs_fzcat _AP((char *fileName));
  37.  
  38. #ifdef __cplusplus
  39. /* declare these as C style functions */
  40. extern "C"
  41.     {
  42. #endif /* def __cplusplus */
  43.  
  44. /* macros for standard functions.  call these in your program.  */
  45. #define s_fopen(name,mode)  fs_fopen((name),(mode))
  46. #define s_fzcat(name)           fs_fzcat((name))
  47. #define s_fclose(file)      { fs_fclose((FILE*)file); file = NULL; }
  48. #define s_fseek(file,offset,wherefrom) fs_fseek(file,offset,wherefrom)
  49. #define s_ftell(file)   fs_ftell(file)
  50.  
  51. void grow_file _AP((FILE* file,long length));
  52. long read_bytes _AP((long n_bytes,FILE *stream));
  53. long write_bytes _AP((long value, long n_bytes, FILE* stream));
  54. long read_bytes_from_memory _AP((long n_bytes, unsigned char* block));
  55.  
  56. time_t file_write_date _AP((char* filename)); /* os dependent */
  57. char *truename _AP((char *filename, char *full_path));
  58. long file_length _AP((FILE* stream));
  59. char *pathname_name _AP((char *pathname));
  60. char *pathname_directory _AP((char *pathname, char *destination));
  61. char *current_user_name _AP((void));
  62. boolean probe_file _AP((char *filename));
  63. boolean probe_file_possibly_compressed _AP((char *filename));
  64. boolean touch_file _AP((char *filename));
  65. char *merge_pathnames _AP((char *pathname, char *directory));
  66.  
  67. #ifdef THINK_C
  68. void setFileType _AP((char* fileName,FType type,FType creator));
  69. #endif /* def THINK_C */
  70.  
  71. #ifdef WIN32
  72. int CanCreateLongFileNames(char *IndexFileName);
  73. #endif
  74.  
  75. boolean read_string_from_file _AP((FILE* stream,char* array,
  76.                    long array_length));
  77.  
  78. long count_lines _AP((FILE *stream));
  79.  
  80. #ifdef __cplusplus
  81.     }
  82. #endif /* def __cplusplus */
  83.  
  84. #endif /* FUTIL_H */
  85.